<template>
  <div>
    <Row class="search-info-style">
      <Col span="6">
        <span>&nbsp;姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名&nbsp;：</span>
        <Input v-model="searchInfo.name" placeholder="姓名" style="width:70%" />
      </Col>
      <Col span="6">
        <span>证件号码：</span>
        <Input v-model="searchInfo.card_no" placeholder="证件号码" style="width:70%" />
      </Col>
      <Col span="6">
        <span>&nbsp;学&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;历&nbsp;：</span>
        <Select clearable v-model="searchInfo.CPEI004" filterable transfer="" style="width: 70%;">
          <Option :value="item.TYPECODE" v-for="item in dictList[7]" v-bind:key="item.TYPECODE">{{item.TYPENAME}}</Option>
        </Select>
      </Col>
      <Col style="float:right" pull="1">
        <Button class="new-btn-sty" @click="findtime()"><Icon type="ios-search" />搜索</Button>
        <Button v-if="this.$store.state.user.severUserInfo.company_grade === '5' || this.$store.state.user.severUserInfo.company_grade === '4'" class="new-btn-sty" @click="add()"><Icon type="md-add" />添加成员</Button>
      </Col>
    </Row>
    <Row class="search-info-style" >
      <Col span="6" v-if="this.$store.state.user.severUserInfo.company_grade < '3'">
        <span>所在区县：</span>
        <Select clearable v-model="searchInfo.area_code" filterable transfer="" style="width: 70%;" @on-change="getMailList2(4,searchInfo.area_code)">
          <Option :value="item.code" v-for="item in mailList1" v-bind:key="item.code">{{item.name}}</Option>
        </Select>
      </Col>
      <Col span="6" v-if="this.$store.state.user.severUserInfo.company_grade <'4'">
        <span>所在街道：</span>
        <Select clearable v-model="searchInfo.parent_code" filterable transfer="" style="width: 70%;" @on-change="getMailList2(5, searchInfo.parent_code)">
          <Option :value="item.code" v-for="item in mailList2" v-bind:key="item.code">{{item.name}}</Option>
        </Select>
      </Col>
      <Col span="6" v-if="this.$store.state.user.severUserInfo.company_grade < '5'">
        <span>所在社区：</span>
        <Select clearable v-model="searchInfo.company_code" filterable transfer="" style="width: 70%;" >
          <Option :value="item.code" v-for="item in mailList3" v-bind:key="item.code">{{item.name}}</Option>
        </Select>
      </Col>
    </Row>

    <Row class="search-info-style" >
      <Col span="6">
        <span>任职情况：</span>
        <Select clearable v-model="searchInfo.situation" placeholder="" style="width: 70%;">
          <Option value="1">村（居）委成员</Option>
          <Option value="2">党委成员</Option>
          <Option value="4">监委成员</Option>
          <Option value="3">交叉任职</Option>
        </Select>
      </Col>
      <Col span="6">
        <span style="">年&#12288;&#12288;龄：</span>
        <Input style="width: 32%;" v-model="searchInfo.start_age" />&#160;~&#160;
        <Input style="width: 32%;" v-model="searchInfo.end_age" />
      </Col>
      <Col span="6">
        <span style="">年&#12288;&#12288;份：</span>
        <DatePicker type="year" placeholder="" v-model="searchInfo.year" style="width: 70%"></DatePicker>
      </Col>
    </Row>

    <Row class="search-info-style" >
      <Col span="6">
        <span>社区/农村：</span>
        <Select clearable v-model="searchInfo.level" placeholder="" style="width: 70%;">
          <Option value="45">村</Option>
          <Option value="40">社区</Option>
        </Select>
      </Col>
    </Row>

    <Table border :columns="columns" :data="data">
      <template slot-scope="{ row }" slot="position">
        <span v-if="row.position === '1'">村（居）民委员会主任</span>
        <span v-if="row.position === '2'">村（居）民委员会副主任</span>
        <span v-if="row.position === '3'">村（居）民委员会委员</span>
        <span v-if="row.position === '4'">村（居）民委员会委员（妇女委员）</span>
      </template>

      <template slot-scope="{ row }" slot="branch">
        <span v-if="row.branch_position === '1'">党组织书记</span>
        <span v-if="row.branch_position === '2'">党组织副书记</span>
        <span v-if="row.branch_position === '3'">党组织委员</span>
        <span v-if="row.branch_position === '4'">党组织委员（宣传委员）</span>
        <span v-if="row.branch_position === '5'">党组织委员（组织委员）</span>
      </template>

      <template slot-scope="{ row }" slot="control">
        <span v-if="row.control_position === '1'">村（居）务监督委员会主任</span>
        <span v-if="row.control_position === '2'">村（居）务监督委员会委员</span>
      </template>

      <template slot-scope="{ row }" slot="sex">
        <span v-if="row.sex == '1'">男</span>
        <span v-if="row.sex == '2'">女</span>
      </template>

      <template slot-scope="{ row }" slot="type">
        <span v-if="row.village == '1' && row.branch == '1'">是</span>
        <span v-if="row.village == '0' || row.branch == '0'">否</span>
      </template>

      <template slot-scope="{row}" slot="CPEI004">
        <span :value="item.TYPECODE" v-for="item in dictList[7]" v-bind:key="item.TYPECODE" v-if="row.CPEI004 == item.TYPECODE">{{item.TYPENAME}}</span>
      </template>
    </Table>
    <Row v-if="loadData == true">
      <Col class="demo-spin-col" span="8" offset="8">
        <Spin fix>
          <Icon type="ios-loading" size=18 class="demo-spin-icon-load"></Icon>
          <div>数据正在加载</div>
        </Spin>
      </Col>
    </Row>
    <Page class="page_style" :total="totalnum" :current="currentPageNo"
          :page-size="currentPageSize" @on-change="changePageNo" show-total  show-sizer @on-page-size-change="size"/>
    <Modal v-model="modalEdit" title="两委成员信息" @on-ok="OK111">
      <Form :model="paramData" >
        <Row class="item1">
          <Col span="7" style="text-align: right" class="">姓名:<span style="color: red">(必填)</span></Col>
          <Col span="12" offset="1">
            <Input v-model="paramData.name" placeholder="请输入姓名"/>
          </Col>
        </Row>
        <Row class="item1">
          <Col span="7" style="text-align: right" class="">证件号码:<span style="color: red">(必填)</span></Col>
          <Col span="12" offset="1">
            <Input v-model="paramData.card_no" placeholder="请输入身份证号码"/>
          </Col>
        </Row>
        <Row class="item1">
          <Col span="7" style="text-align: right" class="">姓别:<span style="color: red">(必填)</span></Col>
          <Col span="12" offset="1">
            <Select v-model="paramData.sex" placeholder="请选择性别">
              <Option value="1">男</Option>
              <Option value="2">女</Option>
            </Select>
          </Col>
        </Row>
        <Row class="item1" v-if="this.$store.state.user.severUserInfo.company_grade === '4'">
          <Col span="7" style="text-align: right" class="">社区/村:<span style="color: red">(必填)</span></Col>
          <Col span="12" offset="1">
            <Select  v-model="paramData.company_code" placeholder="请选择社区/村">
              <Option :value="item.code" v-for="item in mailList3" v-bind:key="item.code">{{item.name}}</Option>
            </Select>
          </Col>
        </Row>
        <Row class="item1">
          <Col span="7" style="text-align: right" class="">学历:<span style="color: red">(必填)</span></Col>
          <Col span="12" offset="1">
            <Select  v-model="paramData.CPEI004" filterable transfer="">
              <Option :value="item.TYPECODE" v-for="item in dictList[7]" v-bind:key="item.TYPECODE">{{item.TYPENAME}}</Option>
            </Select>
          </Col>
        </Row>
        <Row class="item1">
          <Col span="7" style="text-align: right" class="">是否村(居)委成员:<span style="color: red">(必填)</span></Col>
          <Col span="12" offset="1">
            <RadioGroup v-model="paramData.village" @on-change="updateVillage" type="button" button-style="solid">
              <Radio label="1" border>是</Radio>
              <Radio label="0" border >否</Radio>
            </RadioGroup>
          </Col>
        </Row>
        <Row class="item1" v-if="village">
          <Col span="7" style="text-align: right" class="">村（居）委职位:<span style="color: red">(必填)</span></Col>
          <Col span="12" offset="1">
            <Select v-model="paramData.position" placeholder="请选择职位">
              <Option value="1">村（居）民委员会主任</Option>
              <Option value="2">村（居）民委员会副主任</Option>
              <Option value="3">村（居）民委员会委员</Option>
              <Option value="4">村（居）民委员会委员（妇女委员）</Option>
            </Select>
          </Col>
        </Row>
        <Row class="item1">
          <Col span="7" style="text-align: right" class="">是否党委成员:<span style="color: red">(必填)</span></Col>
          <Col span="12" offset="1">
            <RadioGroup v-model="paramData.branch" @on-change="updateBranch" type="button" button-style="solid">
              <Radio label="1" border>是</Radio>
              <Radio label="0" border>否</Radio>
            </RadioGroup>
          </Col>
        </Row>
        <Row class="item1" v-if="branch">
          <Col span="7" style="text-align: right" class="">党委职位:<span style="color: red">(必填)</span></Col>
          <Col span="12" offset="1">
            <Select v-model="paramData.branch_position" placeholder="请选择职位">
              <Option value="1">党组织书记</Option>
              <Option value="2">党组织副书记</Option>
              <Option value="3">党组织委员</Option>
              <Option value="4">党组织委员（宣传委员）</Option>
              <Option value="5">党组织委员（组织委员）</Option>
            </Select>
          </Col>
        </Row>
        <Row class="item1">
          <Col span="7" style="text-align: right" class="">是否监委成员:<span style="color: red">(必填)</span></Col>
          <Col span="12" offset="1">
            <RadioGroup v-model="paramData.control" @on-change="updateControl" type="button" button-style="solid">
              <Radio label="1" border>是</Radio>
              <Radio label="0" border>否</Radio>
            </RadioGroup>
          </Col>
        </Row>
        <Row class="item1" v-if="control">
          <Col span="7" style="text-align: right" class="">监委职位:<span style="color: red">(必填)</span></Col>
          <Col span="12" offset="1">
            <Select v-model="paramData.control_position" placeholder="请选择职位">
              <Option value="1">村（居）务监督委员会主任</Option>
              <Option value="2">村（居）务监督委员会委员</Option>
            </Select>
          </Col>
        </Row>
        <Row class="item1">
          <Col span="7" style="text-align: right" class="">是否法人:<span style="color: red">(必填)</span></Col>
          <Col span="12" offset="1">
            <RadioGroup v-model="paramData.legal_person" type="button" button-style="solid">
              <Radio label="1" border>是</Radio>
              <Radio label="0" border>否</Radio>
            </RadioGroup>
          </Col>
        </Row>
        <Row class="item1">
          <Col span="7" style="text-align: right" class="">任职时间（始）:<span style="color: red">(必填)</span></Col>
          <Col span="12" offset="1">
            <DatePicker type="date" placeholder="选择日期" v-model="paramData.start_time"></DatePicker>
          </Col>
        </Row>
        <Row  class="item1">
          <Col span="7" style="text-align: right" class="">任职时间（终）:<span style="color: red">(必填)</span></Col>
          <Col span="12" offset="1">
            <DatePicker type="date" placeholder="选择日期" v-model="paramData.end_time"></DatePicker>
          </Col>
        </Row>
      </Form>
    </Modal>
    <Modal v-model="modalEdit2" title="再次确认" width="700" cancel-text="关闭"
           @on-ok="ok222(paramData)" @on-cancel="modalEdit2=false" ok-text="确定">
      <div style="color: red; font-size: 3rem; text-align: center;">确定删除此两委成员信息吗！</div>
    </Modal>
    <Modal v-model="modalEdit3" title="两委成员信息" @on-ok="modalEdit3 = false">
      <Form :model="paramData" >
        <Row class="item1">
          <Col span="5" style="text-align: right" class="">姓名:</Col>
          <Col span="12" offset="1">
            <Input disabled v-model="paramData.name" placeholder="请输入姓名"/>
          </Col>
        </Row>
        <Row class="item1">
          <Col span="5" style="text-align: right" class="">证件号码:</Col>
          <Col span="12" offset="1">
            <Input disabled v-model="paramData.card_no" placeholder="请输入身份证号码"/>
          </Col>
        </Row>
        <Row class="item1">
          <Col span="5" style="text-align: right" class="">姓别:</Col>
          <Col span="12" offset="1">
            <Select disabled v-model="paramData.sex" placeholder="请选择性别">
              <Option value="1">男</Option>
              <Option value="2">女</Option>
            </Select>
          </Col>
        </Row>
        <Row class="item1">
          <Col span="5" style="text-align: right" class="">学历:</Col>
          <Col span="12" offset="1">
            <Select disabled v-model="paramData.CPEI004" filterable transfer="">
              <Option :value="item.TYPECODE" v-for="item in dictList[7]" v-bind:key="item.TYPECODE">{{item.TYPENAME}}</Option>
            </Select>
          </Col>
        </Row>
        <Row class="item1">
          <Col span="5" style="text-align: right" class="">是否村(居)委成员:</Col>
          <Col span="12" offset="1">
            <RadioGroup disabled v-model="paramData.village" @on-change="updateVillage" type="button" button-style="solid">
              <Radio disabled label="1" border>是</Radio>
              <Radio disabled label="0" border >否</Radio>
            </RadioGroup>
          </Col>
        </Row>
        <Row class="item1" v-if="village">
          <Col span="5" style="text-align: right" class="">村（居）委职位:</Col>
          <Col span="12" offset="1">
            <Select disabled v-model="paramData.position" placeholder="请选择职位">
              <Option value="1">村（居）民委员会主任</Option>
              <Option value="2">村（居）民委员会副主任</Option>
              <Option value="3">村（居）民委员会委员</Option>
              <Option value="4">村（居）民委员会委员（妇女委员）</Option>
            </Select>
          </Col>
        </Row>
        <Row class="item1">
          <Col span="5" style="text-align: right" class="">是否党委成员:</Col>
          <Col span="12" offset="1">
            <RadioGroup disabled v-model="paramData.branch" @on-change="updateBranch" type="button" button-style="solid">
              <Radio disabled label="1" border>是</Radio>
              <Radio disabled label="0" border>否</Radio>
            </RadioGroup>
          </Col>
        </Row>

        <Row class="item1" v-if="branch">
          <Col span="5" style="text-align: right" class="">党委职位:</Col>
          <Col span="12" offset="1">
            <Select disabled v-model="paramData.branch_position" placeholder="请选择职位">
              <Option value="1">党组织书记</Option>
              <Option value="2">党组织副书记</Option>
              <Option value="3">党组织委员</Option>
              <Option value="4">党组织委员（宣传委员）</Option>
              <Option value="5">党组织委员（组织委员）</Option>
            </Select>
          </Col>
        </Row>
        <Row class="item1">
          <Col span="5" style="text-align: right" class="">是否监委成员:</Col>
          <Col span="12" offset="1">
            <RadioGroup disabled v-model="paramData.control" @on-change="updateControl" type="button" button-style="solid">
              <Radio disabled label="1" border>是</Radio>
              <Radio disabled label="0" border>否</Radio>
            </RadioGroup>
          </Col>
        </Row>
        <Row class="item1" v-if="control">
          <Col span="5" style="text-align: right" class="">党委职位:</Col>
          <Col span="12" offset="1">
            <Select disabled v-model="paramData.control_position" placeholder="请选择职位">
              <Option value="1">村（居）务监督委员会主任</Option>
              <Option value="2">村（居）务监督委员会委员</Option>
            </Select>
          </Col>
        </Row>
        <Row class="item1">
          <Col span="5" style="text-align: right" class="">是否法人:</Col>
          <Col span="12" offset="1">
            <RadioGroup disabled v-model="paramData.legal_person" type="button" button-style="solid">
              <Radio disabled label="1" border>是</Radio>
              <Radio disabled label="0" border>否</Radio>
            </RadioGroup>
          </Col>
        </Row>
        <Row class="item1">
          <Col span="5" style="text-align: right" class="">任职时间（始）:</Col>
          <Col span="12" offset="1">
            <DatePicker disabled type="date" placeholder="选择日期" v-model="paramData.start_time"></DatePicker>
          </Col>
        </Row>
        <Row  class="item1">
          <Col span="5" style="text-align: right" class="">任职时间（终）:</Col>
          <Col span="12" offset="1">
            <DatePicker disabled type="date" placeholder="选择日期" v-model="paramData.end_time"></DatePicker>
          </Col>
        </Row>
      </Form>
    </Modal>
  </div>
</template>
<script>
import { getOffice, getTypeNameList, saveCommitteee, date2str, getCommitteeList, getRegionList, deleteCommittee } from '@/api/eventlist'
export default {
  data () {
    return {
      mailList1: [],
      mailList2: [],
      mailList3: [],
      currentPageNo: 1,
      currentPageSize: 10,
      totalnum: 0,
      company_code: this.$store.state.user.severUserInfo.company_code,
      modalEdit: false,
      modalEdit2: false,
      modalEdit3: false,
      loadData: true,
      village: false,
      branch: false,
      control: false,
      paramData: { village: '0', branch: '0', legal_person: '0', control: '0'},
      paramData2: { village: '0', branch: '0', legal_person: '0', control: '0'},
      searchInfo: {},
      param: {},
      dictList: [],
      reginList: [],
      data: [],
      columns: [
      { title: '序号', type: 'index', width: 80, align: 'center' },
      { title: '姓名', key: 'name', width: 100, align: 'center' },
      { title: '性别', slot: 'sex', width: 80, align: 'center' },
      { title: '身份证号', key: 'card_no', width: 180, align: 'center' },
      { title: '所属社区', key: 'company_name', width: 200, align: 'center' },
      { title: '村（居）委职务', slot: 'position', width: 200, align: 'center' },
      { title: '党委职务', slot: 'branch', width: 200, align: 'center' },
      { title: '监委职务', slot: 'control', width: 200, align: 'center' },
      { title: '交叉任职', slot: 'type', width: 100, align: 'center' },
      { title: '学历', slot: 'CPEI004', width: 100, align: 'center' },
      // { title: '公示开始时间', key: 'end_time', width: 250, align: 'center' },
      // {
      {
        title: '操作',
        key: 'action',
        align: 'center',
        className: 'nopadding',
        minWidth: 150,
        render: (h, params) => {
          let temp = []
          temp.push(
            h('Button', {
              props: { type: 'error', size: 'small' },
              style: { marginRight: '5px', backgroundColor: '#18B0FF', borderColor: '#18B0FF' },
              on: {
                click: () => {
                  this.downLoad(params.row)
                }
              }
            }, '查看')
          )
          if (params.row.company_code == this.company_code) {
            temp.push(
              h('Button', {
                props: { type: 'primary', size: 'small' },
                style: { marginRight: '5px', backgroundColor: '#598ED1', borderColor: '#598ED1' },
                on: {
                  click: () => {
                    this.viewProcess(params.row)
                  }
                }
              }, '编辑'),
              h('Button', {
                props: { type: 'error', size: 'small' },
                style: { marginRight: '5px' },
                on: {
                  click: () => {
                    this.remove(params.row)
                  }
                }
              }, '删除')
            )
          }
          return h('div', temp)
        }
      }
    ],
    }
  },
  methods: {
    init() {
      let param = {
        pageSize: this.currentPageSize,
        pageNo: this.currentPageNo,
        name: this.searchInfo.name,
        card_no: this.searchInfo.card_no,
        CPEI004: this.searchInfo.CPEI004,
        area_code: this.searchInfo.area_code,
        parent_code: this.searchInfo.parent_code,
        company_code: this.searchInfo.company_code,
        situation: this.searchInfo.situation,
        start_age: this.searchInfo.start_age,
        end_age: this.searchInfo.end_age,
        years: date2str(this.searchInfo.year),
        level: this.searchInfo.level
      }
      getCommitteeList(param).then(res => {
        if (res.data.errcode === 0) {
          this.data = res.data.data.results
          this.loadData = false
          this.totalnum = res.data.data.totalRecord
        } else {
          this.$Notice.error({ title: '获取列表失败', desc: res.data.errmsg })
          this.loadData = false
        }
      })
    },
    add() {
      this.paramData = this.paramData2
      this.updateVillage()
      this.updateBranch()
      this.updateControl()
      this.modalEdit = true
    },
    findtime() {
      this.currentPageNo = 1
      this.currentPageSize =  10
      this.init()
    },
    viewProcess(item) {
      this.modalEdit = true
      let param = this.$common.xeUtils.clone(item,true)
      this.paramData = param
      this.updateVillage()
      this.updateBranch()
      this.updateControl()
    },
    remove(item) {
      this.param = item
      this.modalEdit2 = true
    },
    updateVillage() {
      console.log('99999')
      if (this.paramData.village === '1') {
        this.village = true
      } else {
        this.village = false
      }
    },
    updateBranch() {
      if (this.paramData.branch === '1') {
        this.branch = true
      } else {
        this.branch = false
      }
    },
    updateControl() {
      if (this.paramData.control === '1') {
        this.control = true
      } else {
        this.control = false
      }
    },
    downLoad(item) {
      this.modalEdit3 = true
      let param = this.$common.xeUtils.clone(item,true)
      this.paramData = param
      this.updateVillage()
      this.updateBranch()
      this.updateControl()
    },
    OK111() {
      this.paramData.start_time = date2str(this.paramData.start_time)
      this.paramData.end_time = date2str(this.paramData.end_time)
      if (this.paramData.village === '0') {
        this.paramData.position = null
      }
      if (this.paramData.branch === '0') {
        this.paramData.branch_position = null
      }
      if (this.paramData.control === '0') {
        this.paramData.control_position = null
      }
      saveCommitteee(this.paramData).then(res => {
        if (res.data.errcode === 0) {
          this.$Notice.success({ title: '保存成功', desc: '' })
          // this.paramData = this.paramData2
          this.init()
        } else {
          this.$Notice.error({ title: '保存失败', desc: res.data.errmsg })
          this.init()
        }
      })
    },
    ok222() {
      deleteCommittee(this.param).then(res => {
        if (res.data.errcode === 0) {
          this.$Notice.success({ title: '删除成功', desc: '' })
          this.init()
        } else {
          this.$Notice.error({ title: '删除失败！请重试', desc: res.data.errmsg })
          this.init()
        }
      })
    },
    getTypeName (id, index) {
      getTypeNameList({ typegroupcode: id }).then(res => {
        if (res.data.errcode === 0) {
          this.dictList[index] = res.data.data
        } else {
          this.$Notice.error({
            title: '获取字典列表失败',
            desc: res.data.errmsg
          })
        }
      })
    },
    getDictList () {
      this.getTypeName('degree', 7)
    },
    getRegionList (id, index) {
      getRegionList({ id: id }).then(res => {
        if (res.data.errcode === 0) {
          this.reginList[index] = res.data.data
          this.$forceUpdate()
        } else {
          this.$Notice.error({
            title: '获取区域列表失败',
            desc: res.data.errmsg
          })
        }
      })
    },
    size (pageSize) {
      this.currentPageSize = pageSize
      this.changePageNo()
    },
    changePageNo (pageNo) {
      this.currentPageNo = pageNo
      this.init()
    },
    getMailList (grade, code) {
      // this.searchInfo['grade' + (index + 1)] = 0
      getOffice({ grade: grade, code: code }).then(res => {
        if (res.data.errcode === 0) {
          this.mailList1 = res.data.data
          let xiehui = {code: "1", name: "社区工作者协会", master: "社区工作者协会"}
          this.mailList1.push(xiehui)
          // this.mailList[index].unshift({ id: 0, title: '全部' })
          // this.$forceUpdate()
        } else {
          this.$Notice.error({ title: '获取信息失败', desc: '查询区域列表信息失败' })
        }
      })
    },
    getMailList2 (grade, code) {
      // this.searchInfo['grade' + (index + 1)] = 0
      getOffice({ code: code }).then(res => {
        if (res.data.errcode === 0) {
          if (grade === 4) {
            this.mailList2 = res.data.data
            let xiehui = {code: "1", name: "社区工作者协会", master: "社区工作者协会"}
            this.mailList2.push(xiehui)
          } else if (grade === 5) {
            this.mailList3 = res.data.data
          }
          // this.mailList[index].unshift({ id: 0, title: '全部' })
          // this.$forceUpdate()
        } else {
          this.$Notice.error({ title: '获取信息失败', desc: '查询区域列表信息失败' })
        }
      })
    }
  },
  mounted() {
    this.getDictList()
    this.init()
    this.getRegionList('', 0)
    if (this.companyGrade < 3) {
      this.getMailList(2, null)
    } else if (this.companyGrade < 4) {
      this.getMailList2(4, this.companyCode)
    } else if (this.companyGrade < 5) {
      this.getMailList2(5, this.companyCode)
    }
    if (this.$store.state.user.severUserInfo.company_grade === '3') {
      this.getRegionList(this.$store.state.user.severUserInfo.company_code, 1)
    }
    if (this.$store.state.user.severUserInfo.company_grade === '4') {
      this.getRegionList(this.$store.state.user.severUserInfo.company_code, 2)
    }
    if (this.$store.state.user.severUserInfo.company_grade === '5') {
      this.getRegionList(this.$store.state.user.severUserInfo.company_code, 3)
    }
  },
  computed: {
    companyGrade () {
      return this.$store.state.user.severUserInfo.company_grade
    },
    companyCode () {
      return this.$store.state.user.severUserInfo.company_code
    }
  }
}
</script>
<style>
  .search-info-style {
    margin: 10px;
  }
  .new-btn-sty {
    margin-right: 5px;
    color: #fff;
    background-color: #235CA7;
    border-color: #235CA7;
    font-weight: 500;
  }
  .item1{
    height: 42px;
    line-height: 40px;
  }
  .page_style {
    margin-top: 10px;
    text-align: right;
  }
</style>
